home *** CD-ROM | disk | FTP | other *** search
/ QuickTime - The Beta Release / QuickTime - The Beta Release.iso / Programming Stuff / Sample Code / MovieController Exerciser / BigEasy2.h < prev    next >
Text File  |  1991-08-26  |  6KB  |  226 lines

  1. /*
  2.     File:        BigEasy2.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    xxx put writers here xxx
  7.  
  8.     Copyright:    © 1990-1991 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     This file is used in these builds: Warhol
  11.  
  12.     Change History (most recent first):
  13.  
  14.         <13>     8/25/91    JB        Changed #def Ticks to #def GetTicks
  15.         <12>      6/3/91    dvb        Just hackin.
  16.         <11>     5/28/91    JB        Added prototypes for BigEasy Proc Ptrs
  17.         <10>     5/25/91    JB        OLD_THINK_C && TOOLBOX_LINKED
  18.          <9>     5/23/91    PH        functions..
  19.          <8>      5/5/91    dvb        App Open Events
  20.          <7>     4/25/91    JB        Changing to new THINK C interface files
  21.          <6>     4/19/91    dvb        Add WindowEventProc
  22.          <5>     2/24/91    dvb        Various cool new calls
  23.          <4>     2/18/91    dvb        Miscellaneous Updates
  24.          <3>      2/6/91    JB        Made nil #define conditional
  25.          <2>    11/17/90    dvb        Remove subport machinery
  26.          <4>     9/19/90    dvb        Fix graphics math collision
  27.          <3>     9/10/90    dvb        Take Zoomproc out of InstallWindow call.
  28.          <2>     7/31/90    dvb        Modify inclusion hierarchy
  29.  
  30.     To Do:
  31. */
  32.  
  33. /* file: BigEasy2.h
  34.  *
  35.  * Started 4 July 1989, more or less.
  36.  *
  37.  * A set of routines to allow the quick development
  38.  * of simple Macintosh applications.
  39.  *
  40.  */
  41.  
  42. #ifndef BigEasyIncludes
  43. #define BigEasyIncludes
  44.  
  45. #include <Types.h>
  46. #include <Menus.h>
  47. #include <AppleEvents.h>
  48.  
  49. /************************************
  50. * Simple things
  51. ************************************/
  52.  
  53. #if THINK_C < 5
  54.     typedef void (*beUpdateProcPtr)();        /* Function Pointer */
  55.     typedef void (*beClickProcPtr)();        /* Function Pointer */
  56.     typedef void (*beKeyProcPtr)();        /* Function Pointer */
  57.     typedef void (*beGoAwayProcPtr)();        /* Function Pointer */
  58.     typedef void (*beZoomProcPtr)();        /* Function Pointer */
  59.     typedef void (*beActivateProcPtr)();        /* Function Pointer */
  60.     typedef void (*beDeactivateProcPtr)();        /* Function Pointer */
  61.     typedef void (*beIdleProcPtr)();        /* Function Pointer */
  62.     typedef void (*beResizeProcPtr)();        /* Function Pointer */
  63.     typedef void (*beGrowWindowProcPtr)();        /* Function Pointer */
  64.     typedef void (*beEventProcPtr)();        /* Function Pointer */
  65.     typedef void (*beMenuProcPtr)();        /* Function Pointer */
  66.     
  67.     typedef void (*beAboutProcPtr)();        
  68.     typedef void (*beWNumCallProcPtr)();        
  69. #else
  70.     typedef void (*beUpdateProcPtr)(short windowNum);        
  71.     typedef void (*beClickProcPtr)(short windowNum, Point p, short modifiers);        
  72.     typedef void (*beKeyProcPtr)(short windowNum, short key, short keycode, short modifiers);        
  73.     typedef void (*beGoAwayProcPtr)(short windowNum);        
  74.     typedef void (*beZoomProcPtr)(short windowNum);        
  75.     typedef void (*beActivateProcPtr)(short windowNum);        
  76.     typedef void (*beDeactivateProcPtr)(short windowNum);        
  77.     typedef void (*beIdleProcPtr)(short windowNum, Boolean upfront);        
  78.     typedef void (*beResizeProcPtr)(short windowNum, Point *oldSize, Point *newSize, short modifiers);        
  79.     typedef void (*beGrowWindowProcPtr)(long *newSize, short windowNum,
  80.                             WindowPtr w, Point where, Rect *resizeLim);        
  81.     typedef void (*beEventProcPtr)(short windowNum, EventRecord *event, Boolean *tookEvent);        
  82.     typedef void (*beMenuProcPtr)(short windowNum, short menuItem, short menuRef);
  83.     
  84.     typedef void (*beAboutProcPtr)(void);        
  85.     typedef void (*beWNumCallProcPtr)(short windowNum);        
  86. #endif
  87.  
  88.  
  89. #ifndef mathTypesIncludes
  90.     typedef Boolean boolean;
  91. #endif
  92.  
  93. #ifndef nil
  94.     #define nil (0L)
  95. #endif
  96.  
  97. #define SwapShort(a,b) {short temp; temp = a; a = b; b = temp;}
  98.  
  99.  
  100. /************************************
  101. * Types
  102. ************************************/
  103.  
  104. /*
  105.   * Window Flags (as passed to InstallWindow)
  106.   */
  107. typedef enum
  108.     {
  109.     wGrowable = 1,
  110.     wZoomable = 2,
  111.     wCoolDrag = 4                /* Set to do the really cool live-dragwindow trick */
  112.     };
  113.  
  114. /*
  115.  * Built in menu ref-numbers
  116.  */
  117. typedef enum
  118.     {
  119.     mUndo = 30000,
  120.     mCut,
  121.     mCopy,
  122.     mPaste,
  123.     mClear
  124.     };
  125.  
  126. /************************************
  127. * BigEasy2 Public Global Variables
  128. ************************************/
  129. #ifdef BigEasy2
  130.     #define VAR
  131. #else
  132.     #define VAR extern
  133. #endif
  134.  
  135. VAR boolean gQuitApp;
  136. VAR boolean gMenuNeedsCmdKey;
  137. VAR boolean gStaggerWindows;
  138. VAR short gLastModifiers;
  139.  
  140.  
  141. VAR Rect gBigRect;
  142.  
  143. #ifndef __QUICKDRAW__
  144.     #include <QuickDraw.h>
  145. #endif
  146.  
  147. #ifndef __WINDOWS__
  148.     #include <Windows.h>
  149. #endif
  150.  
  151. #undef VAR
  152.  
  153.  
  154. /************************************
  155. * Major BigEasy2 Routines
  156. ************************************/
  157.  
  158. WindowPtr InstallWindow(short iNum,StringPtr iTitle,Rect *iRect,short iType,short newFlags,
  159.         beUpdateProcPtr iUpdate,beClickProcPtr iClick,beKeyProcPtr iKey,beGoAwayProcPtr iGoAway,
  160.         beActivateProcPtr iActivate,beDeactivateProcPtr iDeactivate,beIdleProcPtr iIdle);
  161.  
  162. void UninstallWindow(short iNum);
  163.  
  164. void Show(short inum);
  165. void Hide(short iNum);
  166.  
  167. MenuHandle InstallMenu(StringPtr s,beMenuProcPtr action,short ref);
  168. void InstallMenuItem(StringPtr s,beMenuProcPtr action,short ref);
  169. void DeleteMenuItem(short ref);
  170. void SetMenuItem(short ref,char enable,char isMarked,char mark,StringPtr s);
  171. void EnDisEdits(short Eundo,short Ecut,short Ecopy,short Epaste,short Eclear);
  172. void InstallEditMenu(beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr);
  173. void SetCurrentMenu(short ref);
  174.  
  175. void SetMasterIdle(beAboutProcPtr);
  176. void IdleWindow(short n);
  177.  
  178. void SetMasterOpenAppMessage(EventHandlerProcPtr);
  179. void SetMasterOpenDocMessage(EventHandlerProcPtr);
  180. /*
  181. void SetMasterPrintDocMessage(FP);
  182. void SetMasterQuitMessage(FP);
  183. */
  184.  
  185. void SetWindowResizeProc(short n,beResizeProcPtr resizeProc);
  186. void SetWindowGrowWindowProc(short n,beGrowWindowProcPtr growWindowProc);
  187. void SetWindowZoomProc(short n,beZoomProcPtr iZoom);
  188. void SetWindowEventProc(short n, beEventProcPtr iEvent);
  189. long GetWindowFlags(short n);
  190. void SetWindowFlags(short n,long flags);
  191.  
  192. void GetWindowRect(short n,Rect *r);
  193. WindowPtr GetWindowPtr(short n);
  194. boolean GetWindowVisible(short n);
  195. void Replace1Resource(Handle,long type,short id);
  196. void SaveWindowPosition(short n);
  197. void ForgetWindowPosition(short n);
  198.  
  199. void SetAbout(StringPtr progName,StringPtr s0,beAboutProcPtr aboutProc);
  200.  
  201. void GoWatch(void);
  202. void GoArrow(void);
  203. void GoCursor(short c);
  204.  
  205. void FailNil(long);
  206. void FailOSErr(long);
  207.  
  208. /************************************
  209. * Client Provided BigEasy2 Routines
  210. ************************************/
  211.  
  212. void Bootstrap(void);
  213. void Hatstrap(void);
  214.  
  215.  
  216. /************************************
  217. * Minor BigEasy2 Hacks
  218. ************************************/
  219. #ifndef BigEasy2
  220.     #define FailNil(x)    FailNil((long)(x))                    /* Simulate a typeless call            */
  221.     #define FailOSErr(x)    FailOSErr((long)(x))            /* Simulate a typeless call            */
  222. #endif
  223.  
  224. #define GetTicks() (*(long *)Ticks)
  225.  
  226. #endif